<?php
session_start();
// set timeout period in seconds
$inactive = 1800;
// check to see if $_SESSION['timeout'] is set
//if(isset($_SESSION['timeout']) ) {
$session_life = time() - $_SESSION['start'];
if($session_life > $inactive){ 
	session_destroy(); 
	header("Location: index.php"); 
}else{
	$_SESSION['start'] = time();
	$user_type = $_SESSION["sess_user_type"];
	if($user_type==""){
		header("Location: index.php");
	}
}
//}
//$_SESSION['timeout'] = time();
?>